<template>
  <div>
    <!-- 搜索框 -->
    <div>
      <a-input-search
      v-model:value="value"
      placeholder="input search text"
      enter-button="Search"
      size="large"
      @search="onSearch"
    />
    </div>

    <h1>{{ title }}</h1>
    <h1>{{ note.text }}</h1>
    <a-list size="large" bordered :data-source="note.noteList" >
      <template #renderItem="{ item }">
         <router-link :to="'/note/read/' + item.ID " > <a-list-item>{{ item.Title }}</a-list-item> </router-link>
      </template>

      <template #header>
        <div>Header</div>
      </template>

      <template #footer>
        <div>
          <a-pagination v-model:current="current" :total="10" />
        </div>
      </template>
    </a-list>
  </div>
</template>

<script setup>
import { ref, reactive } from 'vue'
import { noteStore } from '../state/noteStore'

const note = noteStore()
const title = ref('笔记列表')
reactive(note)

// 获取列表数据
note.getList()

</script>

<style>

</style>
